{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "3da6b22c-c820-4f5d-a66f-05f913ce6fa3",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/n_r_baseline3/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.774      0.747      0.808      0.551\n",
      "                   car       4952       1201      0.816      0.882      0.916      0.691\n",
      "                person       4952       4528      0.847      0.796      0.884      0.577\n",
      "             aeroplane       4952        285      0.907      0.786      0.867      0.556\n",
      "               bicycle       4952        337      0.875      0.792      0.884      0.612\n",
      "                  bird       4952        459      0.789      0.708      0.781      0.493\n",
      "                  boat       4952        263      0.686      0.605      0.687      0.403\n",
      "                bottle       4952        469      0.658      0.744      0.759      0.505\n",
      "                   bus       4952        213      0.824      0.826      0.889      0.732\n",
      "                   cat       4952        358       0.85      0.737      0.836      0.591\n",
      "                 chair       4952        756      0.591       0.63      0.646       0.42\n",
      "                   cow       4952        244      0.756      0.815      0.852      0.608\n",
      "           diningtable       4952        206      0.705      0.723      0.756      0.509\n",
      "                   dog       4952        489      0.796      0.687       0.82      0.551\n",
      "                 horse       4952        348      0.875      0.853        0.9      0.615\n",
      "             motorbike       4952        325      0.856      0.769      0.867      0.554\n",
      "           pottedplant       4952        480      0.641      0.535      0.577      0.326\n",
      "                 sheep       4952        242      0.705      0.814      0.823      0.595\n",
      "                  sofa       4952        239      0.701      0.669      0.738       0.54\n",
      "                 train       4952        282       0.84      0.782      0.859      0.568\n",
      "             tvmonitor       4952        308      0.751      0.794      0.809      0.582\n",
      "Speed: 0.1ms pre-process, 1.6ms inference, 1.5ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp11\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/n_r_baseline3/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.926      0.146      0.237      0.131\n",
      "                   car       2245       8402      0.797      0.674      0.744       0.41\n",
      "                   van       2245        871          1          0      0.334      0.233\n",
      "                 truck       2245        351          1          0      0.305      0.169\n",
      "                  tram       2245        156          1          0    0.00542    0.00217\n",
      "                person       2245       1347       0.61      0.497      0.494      0.228\n",
      "        person_sitting       2245         91          1          0          0          0\n",
      "               cyclist       2245        468          1          0          0          0\n",
      "                  misc       2245        292          1          0      0.012    0.00898\n",
      "Speed: 0.0ms pre-process, 0.8ms inference, 1.6ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp12\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# baseline\n",
    "model = f'runs/train/n_r_baseline3/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e1e7138e-19f4-408d-b291-d072874372ee",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9451d111-8573-4d15-b8d3-47b85ba692d9",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "f655d3a9-b7bb-4f3f-98b5-70830751703b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/n_r_Lwf6/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.746      0.733      0.783       0.52\n",
      "                   car       4952       1201      0.788      0.877      0.903      0.668\n",
      "                person       4952       4528      0.817      0.803      0.869      0.567\n",
      "             aeroplane       4952        285      0.858      0.782      0.848      0.528\n",
      "               bicycle       4952        337      0.861       0.78       0.87      0.582\n",
      "                  bird       4952        459      0.736      0.666      0.706      0.438\n",
      "                  boat       4952        263      0.603       0.62      0.646      0.374\n",
      "                bottle       4952        469      0.658      0.727      0.731       0.48\n",
      "                   bus       4952        213      0.799      0.842      0.854      0.687\n",
      "                   cat       4952        358      0.828      0.685      0.803      0.536\n",
      "                 chair       4952        756      0.564      0.614      0.621      0.391\n",
      "                   cow       4952        244      0.688      0.783       0.81      0.562\n",
      "           diningtable       4952        206      0.742      0.684       0.76      0.483\n",
      "                   dog       4952        489      0.762      0.682      0.784      0.503\n",
      "                 horse       4952        348      0.872       0.81      0.886        0.6\n",
      "             motorbike       4952        325      0.823       0.76      0.849      0.537\n",
      "           pottedplant       4952        480      0.573      0.546      0.551      0.289\n",
      "                 sheep       4952        242      0.672      0.822      0.829      0.576\n",
      "                  sofa       4952        239      0.658      0.653      0.713      0.509\n",
      "                 train       4952        282      0.871      0.755      0.847       0.55\n",
      "             tvmonitor       4952        308      0.745       0.76      0.781      0.544\n",
      "Speed: 0.1ms pre-process, 1.8ms inference, 1.5ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/n_r_Lwf6/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test... 2245 images, 0 bac\u001b[0m\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mNew cache created: /root/autodl-tmp/datasets/kitti/labels/test.cache\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.795      0.197      0.408      0.201\n",
      "                   car       2245       8402       0.57      0.831      0.791      0.456\n",
      "                   van       2245        871      0.813     0.0946      0.442      0.232\n",
      "                 truck       2245        351          1     0.0474      0.671      0.381\n",
      "                  tram       2245        156          1          0       0.41      0.173\n",
      "                person       2245       1347      0.415      0.592      0.515       0.24\n",
      "        person_sitting       2245         91          1          0      0.145     0.0377\n",
      "               cyclist       2245        468       0.56     0.0107      0.221      0.061\n",
      "                  misc       2245        292          1          0     0.0727     0.0306\n",
      "Speed: 0.0ms pre-process, 0.7ms inference, 1.2ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp2\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# Lwf1e-4\n",
    "model = f'runs/train/n_r_Lwf6/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "fb4e7fe0-1303-4b90-917d-afd6b08ec1f5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "id": "5c4c5cbc-69e0-4f31-bc52-5f34741e76f5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/n_r_Lwf7/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.554      0.507      0.521      0.279\n",
      "                   car       4952       1201      0.693      0.718       0.75      0.496\n",
      "                person       4952       4528      0.708      0.661      0.713      0.386\n",
      "             aeroplane       4952        285      0.532      0.568      0.541      0.252\n",
      "               bicycle       4952        337      0.692      0.567      0.643      0.342\n",
      "                  bird       4952        459      0.484      0.379      0.397      0.197\n",
      "                  boat       4952        263      0.404      0.403      0.335       0.14\n",
      "                bottle       4952        469      0.463      0.503      0.478      0.262\n",
      "                   bus       4952        213      0.554      0.577      0.607      0.408\n",
      "                   cat       4952        358       0.67      0.363      0.512      0.237\n",
      "                 chair       4952        756      0.418      0.386      0.373      0.196\n",
      "                   cow       4952        244      0.545      0.533       0.51      0.309\n",
      "           diningtable       4952        206       0.53      0.515      0.476      0.214\n",
      "                   dog       4952        489      0.602      0.368      0.465      0.229\n",
      "                 horse       4952        348      0.541      0.603      0.584      0.291\n",
      "             motorbike       4952        325       0.65      0.545      0.596      0.304\n",
      "           pottedplant       4952        480      0.434      0.327      0.303       0.12\n",
      "                 sheep       4952        242      0.437      0.591      0.572      0.362\n",
      "                  sofa       4952        239      0.579      0.435      0.458      0.258\n",
      "                 train       4952        282      0.608      0.532       0.56      0.264\n",
      "             tvmonitor       4952        308      0.545      0.568      0.546       0.32\n",
      "Speed: 0.1ms pre-process, 1.3ms inference, 1.1ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp3\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/n_r_Lwf7/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.665      0.572      0.608      0.296\n",
      "                   car       2245       8402      0.707      0.859      0.858      0.509\n",
      "                   van       2245        871      0.862      0.636      0.765      0.446\n",
      "                 truck       2245        351      0.907      0.761      0.877      0.429\n",
      "                  tram       2245        156      0.617      0.506      0.603      0.283\n",
      "                person       2245       1347      0.496       0.63       0.58      0.278\n",
      "        person_sitting       2245         91       0.21      0.703      0.295     0.0909\n",
      "               cyclist       2245        468      0.706      0.374       0.47      0.136\n",
      "                  misc       2245        292      0.819      0.108      0.416      0.199\n",
      "Speed: 0.0ms pre-process, 1.0ms inference, 2.2ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp4\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# Lwf1e-3\n",
    "model = f'runs/train/n_r_Lwf7/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3695d1b4-3a81-4e82-8074-ccdfcbdd9b08",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "1e2db318-fba6-46a7-a77f-1b707a740058",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/test24/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.764      0.762      0.808      0.548\n",
      "                   car       4952       1201      0.825      0.887      0.919      0.691\n",
      "                person       4952       4528      0.842       0.81      0.885      0.579\n",
      "             aeroplane       4952        285      0.864      0.804      0.865       0.55\n",
      "               bicycle       4952        337       0.88      0.804      0.894      0.602\n",
      "                  bird       4952        459      0.773      0.702      0.768      0.483\n",
      "                  boat       4952        263      0.683      0.688      0.728      0.417\n",
      "                bottle       4952        469       0.62      0.751      0.755        0.5\n",
      "                   bus       4952        213      0.828      0.831        0.9      0.736\n",
      "                   cat       4952        358      0.855      0.776      0.832      0.593\n",
      "                 chair       4952        756       0.58      0.643      0.648      0.416\n",
      "                   cow       4952        244      0.747      0.791      0.827      0.592\n",
      "           diningtable       4952        206       0.69      0.703      0.751      0.499\n",
      "                   dog       4952        489      0.795      0.721      0.813      0.551\n",
      "                 horse       4952        348      0.844      0.856      0.887      0.619\n",
      "             motorbike       4952        325      0.865      0.803      0.883      0.566\n",
      "           pottedplant       4952        480      0.631      0.569      0.585      0.318\n",
      "                 sheep       4952        242      0.688      0.785      0.806      0.562\n",
      "                  sofa       4952        239      0.689      0.703      0.749      0.549\n",
      "                 train       4952        282      0.836      0.812      0.859      0.569\n",
      "             tvmonitor       4952        308      0.739      0.792      0.812      0.565\n",
      "Speed: 0.1ms pre-process, 1.2ms inference, 0.7ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp5\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/test24/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.927      0.145      0.225      0.128\n",
      "                   car       2245       8402      0.812      0.668      0.739       0.41\n",
      "                   van       2245        871          1          0      0.316       0.21\n",
      "                 truck       2245        351          1          0      0.196      0.133\n",
      "                  tram       2245        156          1          0     0.0144    0.00668\n",
      "                person       2245       1347      0.607      0.492      0.489      0.227\n",
      "        person_sitting       2245         91          1          0          0          0\n",
      "               cyclist       2245        468          1          0          0          0\n",
      "                  misc       2245        292          1          0     0.0424      0.035\n",
      "Speed: 0.0ms pre-process, 0.9ms inference, 1.4ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp6\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# EWC\n",
    "model = f'runs/train/test24/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "009e04fb-6bbc-447a-98db-d15cee593e4d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3d644d2d-0e13-49f5-b4e7-ecaaee6cde0d",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "c68488cf-d647-44c3-964f-8317c0a2198d",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/SI2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.751      0.759      0.805      0.547\n",
      "                   car       4952       1201      0.803      0.892      0.921      0.694\n",
      "                person       4952       4528      0.829       0.82      0.885      0.578\n",
      "             aeroplane       4952        285      0.854       0.78      0.853      0.539\n",
      "               bicycle       4952        337      0.846      0.786      0.875      0.593\n",
      "                  bird       4952        459      0.742      0.706      0.773      0.485\n",
      "                  boat       4952        263      0.654      0.668      0.694      0.398\n",
      "                bottle       4952        469      0.638      0.733      0.754      0.502\n",
      "                   bus       4952        213        0.8      0.828      0.878      0.706\n",
      "                   cat       4952        358      0.843      0.779      0.849      0.605\n",
      "                 chair       4952        756      0.585      0.624      0.639      0.415\n",
      "                   cow       4952        244       0.72      0.828      0.845      0.613\n",
      "           diningtable       4952        206      0.665      0.714      0.728        0.5\n",
      "                   dog       4952        489      0.802      0.722      0.832      0.559\n",
      "                 horse       4952        348      0.861      0.855      0.895      0.623\n",
      "             motorbike       4952        325      0.841      0.782      0.881      0.552\n",
      "           pottedplant       4952        480      0.616      0.571      0.571      0.311\n",
      "                 sheep       4952        242      0.674      0.802      0.821      0.576\n",
      "                  sofa       4952        239      0.672      0.707      0.753      0.559\n",
      "                 train       4952        282      0.805      0.819      0.843      0.558\n",
      "             tvmonitor       4952        308       0.76      0.761      0.812      0.583\n",
      "Speed: 0.1ms pre-process, 1.2ms inference, 0.7ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp13\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/SI2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.929      0.147      0.224      0.128\n",
      "                   car       2245       8402      0.816      0.679      0.755      0.418\n",
      "                   van       2245        871          1          0      0.361       0.26\n",
      "                 truck       2245        351          1          0      0.116     0.0732\n",
      "                  tram       2245        156          1          0     0.0187     0.0112\n",
      "                person       2245       1347      0.616      0.493      0.497       0.23\n",
      "        person_sitting       2245         91          1          0          0          0\n",
      "               cyclist       2245        468          1          0          0          0\n",
      "                  misc       2245        292          1          0     0.0426     0.0312\n",
      "Speed: 0.0ms pre-process, 0.7ms inference, 0.8ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp14\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# SI2\n",
    "model = f'runs/train/SI2/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ff73e79b-d527-4cae-a1df-d1c1ffb1ab65",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3f596fb9-f459-41de-b98c-4c62317d4130",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "880cac3b-1e7c-4d4a-8c68-5287fb53206c",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bd018615-d776-433f-9f40-4296eef1de12",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "5d6ef1c6-7aff-4e62-a524-5beb95b811fb",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/r_base2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.769      0.769      0.817      0.561\n",
      "                   car       4952       1201      0.817      0.899      0.921      0.691\n",
      "                person       4952       4528      0.838       0.81      0.882      0.579\n",
      "             aeroplane       4952        285      0.911      0.846      0.899      0.581\n",
      "               bicycle       4952        337      0.868      0.825      0.901       0.63\n",
      "                  bird       4952        459      0.748      0.747      0.778      0.496\n",
      "                  boat       4952        263      0.614      0.681      0.687      0.399\n",
      "                bottle       4952        469      0.656      0.722      0.751      0.491\n",
      "                   bus       4952        213      0.818      0.831      0.889       0.72\n",
      "                   cat       4952        358      0.832      0.777       0.85      0.608\n",
      "                 chair       4952        756      0.629      0.641      0.678      0.435\n",
      "                   cow       4952        244      0.735      0.863       0.88      0.637\n",
      "           diningtable       4952        206      0.709      0.709      0.748      0.519\n",
      "                   dog       4952        489      0.812      0.709      0.828      0.568\n",
      "                 horse       4952        348      0.848      0.842      0.897      0.622\n",
      "             motorbike       4952        325      0.835      0.806      0.881       0.57\n",
      "           pottedplant       4952        480      0.672      0.535      0.571        0.3\n",
      "                 sheep       4952        242      0.725      0.839      0.855      0.621\n",
      "                  sofa       4952        239      0.679      0.674      0.746      0.558\n",
      "                 train       4952        282       0.88       0.81       0.87      0.588\n",
      "             tvmonitor       4952        308      0.754      0.816      0.833      0.599\n",
      "Speed: 0.1ms pre-process, 1.6ms inference, 2.1ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp15\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/r_base2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.808      0.734      0.805       0.49\n",
      "                   car       2245       8402      0.906      0.859      0.935       0.68\n",
      "                   van       2245        871      0.881      0.757      0.871      0.595\n",
      "                 truck       2245        351      0.896      0.906      0.947       0.68\n",
      "                  tram       2245        156      0.702      0.827        0.8       0.45\n",
      "                person       2245       1347      0.852       0.65      0.757      0.386\n",
      "        person_sitting       2245         91      0.607      0.473      0.566      0.246\n",
      "               cyclist       2245        468      0.782      0.709      0.787      0.436\n",
      "                  misc       2245        292      0.835      0.688      0.777       0.45\n",
      "Speed: 0.1ms pre-process, 1.2ms inference, 4.6ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp16\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# r_base2\n",
    "model = f'runs/train/r_base2/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c04baa0c-0dfd-48b5-b9a5-bbcd5c0704d1",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "760e2908-65ca-4074-8178-6ef3527c7165",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "11930f34-125a-4659-869a-8a0266d009e4",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "a07bf6c3-4195-4b21-8ad1-f71462c65b19",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/DER2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 375 layers, 14269508 parameters, 0 gradients, 81.1 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.777      0.772      0.828      0.574\n",
      "                   car       4952       1201      0.811      0.893      0.922        0.7\n",
      "                person       4952       4528      0.837      0.821      0.889      0.593\n",
      "             aeroplane       4952        285      0.878      0.828       0.89      0.589\n",
      "               bicycle       4952        337      0.899      0.794      0.903      0.631\n",
      "                  bird       4952        459       0.76      0.751      0.789      0.516\n",
      "                  boat       4952        263      0.625      0.677      0.726      0.425\n",
      "                bottle       4952        469      0.702      0.727      0.779       0.53\n",
      "                   bus       4952        213      0.802       0.85        0.9      0.744\n",
      "                   cat       4952        358      0.883      0.777       0.88      0.637\n",
      "                 chair       4952        756       0.63      0.642      0.682      0.439\n",
      "                   cow       4952        244      0.744      0.877      0.876       0.64\n",
      "           diningtable       4952        206      0.779      0.683      0.774      0.543\n",
      "                   dog       4952        489      0.808      0.746      0.834      0.582\n",
      "                 horse       4952        348      0.867      0.885      0.913      0.648\n",
      "             motorbike       4952        325      0.853      0.803      0.887       0.57\n",
      "           pottedplant       4952        480      0.654      0.533      0.574      0.304\n",
      "                 sheep       4952        242      0.723      0.822      0.844      0.616\n",
      "                  sofa       4952        239      0.702      0.682      0.758      0.578\n",
      "                 train       4952        282      0.849      0.798      0.869      0.579\n",
      "             tvmonitor       4952        308      0.742      0.857      0.862      0.618\n",
      "Speed: 0.1ms pre-process, 3.0ms inference, 1.7ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp17\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/DER2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 375 layers, 14269508 parameters, 0 gradients, 81.1 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.844      0.747      0.828      0.516\n",
      "                   car       2245       8402      0.926      0.861      0.943      0.697\n",
      "                   van       2245        871      0.916      0.792      0.904      0.632\n",
      "                 truck       2245        351      0.935      0.912      0.959      0.708\n",
      "                  tram       2245        156      0.786      0.808      0.838      0.473\n",
      "                person       2245       1347      0.865      0.661      0.775      0.406\n",
      "        person_sitting       2245         91      0.631      0.527      0.571      0.275\n",
      "               cyclist       2245        468      0.871       0.72       0.82      0.449\n",
      "                  misc       2245        292      0.819      0.696      0.814       0.49\n",
      "Speed: 0.1ms pre-process, 2.3ms inference, 4.5ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp18\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# DER2\n",
    "model = f'runs/train/DER2/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d38d6fd4-e275-415c-aa8a-1f70531f5022",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "e0d291af-b1ac-4a8c-8c3a-916b732f1ef8",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "d12a4541-17a9-4820-b4d8-0b5e262cee90",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/VOCKITTI.yaml, weights=['runs/train/POD2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/VOC/labels/test2007.cache... 4952 image\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       4952      12032      0.761      0.735      0.791      0.534\n",
      "                   car       4952       1201      0.777      0.885      0.909      0.676\n",
      "                person       4952       4528      0.838      0.807      0.876      0.571\n",
      "             aeroplane       4952        285      0.872      0.804       0.86      0.545\n",
      "               bicycle       4952        337      0.889      0.783      0.882      0.598\n",
      "                  bird       4952        459      0.702      0.712      0.738      0.466\n",
      "                  boat       4952        263      0.633      0.612      0.668      0.381\n",
      "                bottle       4952        469      0.718      0.706      0.742      0.501\n",
      "                   bus       4952        213      0.804       0.79      0.872      0.692\n",
      "                   cat       4952        358       0.85      0.695      0.822      0.569\n",
      "                 chair       4952        756      0.595      0.602      0.631      0.405\n",
      "                   cow       4952        244      0.712       0.84      0.833      0.601\n",
      "           diningtable       4952        206      0.723      0.658      0.736      0.482\n",
      "                   dog       4952        489       0.78      0.689      0.788      0.522\n",
      "                 horse       4952        348      0.886      0.845      0.891      0.611\n",
      "             motorbike       4952        325      0.851      0.794       0.87      0.553\n",
      "           pottedplant       4952        480      0.634      0.483      0.533      0.289\n",
      "                 sheep       4952        242      0.718      0.814      0.828      0.591\n",
      "                  sofa       4952        239      0.664      0.645      0.704      0.507\n",
      "                 train       4952        282      0.872      0.759      0.839      0.546\n",
      "             tvmonitor       4952        308       0.71       0.78      0.802      0.569\n",
      "Speed: 0.1ms pre-process, 1.2ms inference, 0.7ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp21\u001b[0m\n",
      "VOC val successful|ly!\n",
      "/root/autodl-tmp/yolo_incremental_learning/utils/general.py:32: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.\n",
      "  import pkg_resources as pkg\n",
      "\u001b[34m\u001b[1mval: \u001b[0mdata=data/kitti_increment.yaml, weights=['runs/train/POD2/weights/last.pt'], batch_size=32, imgsz=640, conf_thres=0.001, iou_thres=0.6, max_det=300, task=test, device=, workers=8, single_cls=False, augment=False, verbose=False, save_txt=False, save_hybrid=False, save_conf=False, save_json=False, project=runs/val, name=exp, exist_ok=False, half=False, dnn=False\n",
      "YOLOv5 🚀 1fa09d14 Python-3.12.3 torch-2.5.1+cu124 CUDA:0 (NVIDIA GeForce RTX 3090, 24135MiB)\n",
      "\n",
      "Fusing layers... \n",
      "YOLOv5s_VOCKITTI summary: 157 layers, 7080247 parameters, 0 gradients, 16.0 GFLOPs\n",
      "\u001b[34m\u001b[1mtest: \u001b[0mScanning /root/autodl-tmp/datasets/kitti/labels/test.cache... 2245 images,\u001b[0m\n",
      "                 Class     Images  Instances          P          R      mAP50   \n",
      "                   all       2245      11978      0.835      0.743      0.825      0.511\n",
      "                   car       2245       8402      0.912      0.867       0.94      0.694\n",
      "                   van       2245        871      0.899      0.799      0.894      0.622\n",
      "                 truck       2245        351      0.901      0.909      0.952      0.689\n",
      "                  tram       2245        156      0.702       0.84      0.836      0.466\n",
      "                person       2245       1347      0.898      0.627      0.764      0.394\n",
      "        person_sitting       2245         91      0.621      0.505      0.589      0.272\n",
      "               cyclist       2245        468      0.901        0.7       0.82      0.459\n",
      "                  misc       2245        292      0.846      0.696      0.805      0.496\n",
      "Speed: 0.0ms pre-process, 0.7ms inference, 0.8ms NMS per image at shape (32, 3, 640, 640)\n",
      "Results saved to \u001b[1mruns/val/exp22\u001b[0m\n",
      "KITTI val successfully!\n"
     ]
    }
   ],
   "source": [
    "# POD\n",
    "model = f'runs/train/POD2/weights/last.pt'\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/VOCKITTI.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'VOC val successful|ly!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n",
    "\n",
    "val_command = f\" \\\n",
    "python val.py \\\n",
    "--data data/kitti_increment.yaml \\\n",
    "--weights {model} \\\n",
    "--task test &&\\\n",
    "echo 'KITTI val successfully!' \\\n",
    "\" \n",
    "!{val_command}\n",
    "\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "134f92f7-35c3-4dbf-85fb-21d99737bb95",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
